{include file="index/head" /}
<div class="box">
   <form method="post" action="{:url('editnav')}" class="sycmsform">
  <div class="box-head">
    <h2>{$v.id?'编辑':'添加'}导航</h2>
    <div class="fr"><button type="submit" class="btn"><i class="icon-check"></i>{$v.id?'编辑':'添加'}</button> &nbsp;<a href="javascript:history.go(-1);" class="btn fr"><i class="icon-mail-reply (alias)"></i>返回</a></div>
  </div>
  <div class="form">   
    <input type="hidden" name="id" value="{$v.id}" />
    <ul>      
      <li>
        <label>导航名称：</label>
        <div class="item">
        <input type="text" name="title" value="{$v.title}" maxlength="15" class="input" datatype="*" nullmsg="请输入导航名称"/></div>
      </li> 
       <li><label>英文名称：</label>
      	  <div class="item">
          <input type="text" class="input" name="entitle" value="{$v.entitle}" />          
          </div>
      </li>   
     <li><label>图标：</label>
      	  <div class="item">
          <input type="text" class="input" name="icon" value="{$v.icon|default='icon-leaf'}" />
          <a href="javascript:void(0);" onclick="showico('icon')" class="btn" style="margin-top:6px; float:left; margin-left:12px;">
          <i class="{$v.icon|default='icon-leaf'}"></i> &nbsp;浏览图标</a>          
          </div>
      </li>   
     <li>
        <label>所属模块：</label>
        <div class="item">
          <div class="select"><i class="icon-caret-down"></i>
          <input type="hidden" name="mid" value="{$v.mid|default='1'}" class="inputval" />          
          <input type="text" readonly="readonly" placeholder="请选择模块" value="" datatype="*" nullmsg="请选择所属模块" class="input" />
          <dl class="select-value syui-anim syui-anim-up">   
            {volist name="list" id="vo"}         
            <dd data="{$vo.id}" {if condition="$vo.id eq $v.mid"}class=selected{/if}>{$vo.title}</dd>
            {/volist}           
          </dl>
        </div>        
        </div> 
      </li>  
      <li><label>列表模板：</label>
      	  <div class="item">
          <input type="text" class="input" name="list_tpl" value="{$v.list_tpl}" />          
          </div>
      </li>  
      <li><label>内容模板：</label>
      	  <div class="item">
          <input type="text" class="input" name="msg_tpl" value="{$v.msg_tpl}" />          
          </div>
      </li>  
       <li><label>SEO标题：</label>
      	  <div class="item"><input type="text" class="input w100" value="{$v.seo_title}" name="seo_title"  />            
          </div>
      </li> 
       <li><label>SEO关键字：</label>
      	  <div class="item">
          <input type="text" class="input w100" value="{$v.seo_keywords}" name="seo_keywords"  />          
          </div>
      </li> 
       <li><label>SEO描述：</label>
      	  <div class="item">
          <textarea type="text" class="input w100" name="seo_description">{$v.seo_description}</textarea>         
          </div>
      </li>  
      <li style="margin-top:12px;"><label>导航显示：</label>
      	  <div class="item">
          <input type="hidden" value="{$v.isshow}" name="isshow" />
          <div class="switch {$v.isshow==1?on:''}"><em ontxt="显示" offtxt="隐藏">{$v.isshow==1?'显示':'隐藏'}</em><i></i></div>
          </div>
      </li>   
       <li><label>显示分类：</label>
      	  <div class="item">
          <input type="hidden" value="{$v.showcate}" name="showcate" />
          <div class="switch {$v.showcate==1?on:''}"><em ontxt="显示" offtxt="隐藏">{$v.showcate==1?'显示':'隐藏'}</em><i></i></div>
          </div>
      </li>  
       <li><label>生成缩略图：</label>
      	  <div class="item">
          <input type="hidden" value="{$v.isthumb}" name="isthumb" />
          <div class="switch {$v.isthumb==1?on:''}"><em ontxt="是" offtxt="否">{$v.isthumb==1?'是':'否'}</em><i></i></div>
          </div>
      </li>  
       <li><label>缩略图宽：</label>
      	  <div class="item">
          <input type="text" class="input" name="thumbwidth" datatype="n" value="{$v.thumbwidth}" ignore="ignore" />  <span class="tips">只能填写数字</span>        
          </div>
      </li>  
       <li><label>缩略图高：</label>
      	  <div class="item">
          <input type="text" class="input" name="thumbheight" datatype="n" value="{$v.thumbheight}" ignore="ignore"/> <span class="tips">只能填写数字</span>            
          </div>
      </li>  
        <li><label>图片大小提示：</label>
      	  <div class="item">
          <input type="text" class="input" name="imgtips" value="{$v.imgtips}" /> <span class="tips">例如：建议尺寸：500*500</span>        
          </div>
      </li>  
       <li><label>排序：</label>
      	  <div class="item">
          <input type="text" class="input" type="number" value="{$v.sort}" name="sort"  />          
          </div>
      </li>
      <li>
        <label>导航描述：</label>
        <div class="item"><textarea name="content" class="input" style="height:80px;">{$v.content}</textarea></div>
      </li>
      <li><label>&nbsp;</label><div class="item"><button type="submit" class="button"><i class="icon-check"></i>{$v.id?'编辑':'添加'}</button></div></li>
    </ul>
    </form>
  </div>
</div>
<script> 
sycms.submitform("{:url('nav')}"); 
function showico(name){
  var name = name;	
  $.get("{:url('Common/icon')}",{name:name},function(data){						
	  layer.open({
			title:'图标预览',
			type: 1,				  
			area: ['675px','510px'], //宽高
			content: data,
	  });		
  })
}
</script>